/*
 * startup-init.cpp
 *
 *  Created on: 08.03.2013
 *      Author: SomeChineseGuy
 */

#include <string>
#include <iostream>

#include <GL/glfw.h>


#include "startup-init.h"
#include "window-ctrl.h"


using namespace std;

unsigned int initialize() {

	//initialize GLFW
	if (glfwInit() != GL_TRUE) {
		return 1;//GLFW init failure
	}

	if (createWindow() != 0) {
		return 2; //window initialization failure
	}

	return 0;//everything's OK
}


string getInitializingErrorByCode(int code) {
	string result;
	switch(code) {
		case 1: result = "GLFW initialization failure";break;
		case 2: result = "GLFW window open failure";
	}

	return result;
}


void cleanup() {

	//stop GLFW
	glfwTerminate();

}
